const mongoose = require('mongoose')
const Schema = mongoose.Schema

const orderSchema = mongoose.Schema({
  user: {
    type: Schema.Types.ObjectId,
    ref: 'user'
  },
  saler: {
    type: Schema.Types.ObjectId,
    ref: 'user'
  },
  coin: Number,
  status: Number,
  createAt: {
    type: Date,
    default: new Date()
  }
})

module.exports = mongoose.model('order', orderSchema)
